﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using ZG_member.Model;
using Maticsoft.DBUtility;
using System.Data.SqlClient;
using System.Data;

namespace ZG_member.DAL
{
    public class collection
    {
        public bool add(Model.collection collmodle) {
            StringBuilder strSql = new StringBuilder();
            strSql.Append("insert into collection(");
            strSql.Append("collectionsresult,phone,time,memberid)");
            strSql.Append("values (");
            strSql.Append("@collectionsresult,@phone,@time,@memberid)");
            SqlParameter[] parameters = {
					 
					new SqlParameter("@collectionsresult", SqlDbType.NVarChar,50),
					new SqlParameter("@phone", SqlDbType.NVarChar,500),
                    new SqlParameter("@time", SqlDbType.DateTime,500),
                    new SqlParameter("@memberid", SqlDbType.NVarChar,500)
					};

            parameters[0].Value = collmodle.Collectionsresult;
            parameters[1].Value = collmodle.Phone;
            parameters[2].Value = collmodle.Time;
            parameters[3].Value = collmodle.Memberid;
            object obj = DbHelperSQL.ExecuteSql(strSql.ToString(), parameters);

            if (obj == null)
            {
                return false;
            }
            else
            {
                return true;
            }


        }


        public DataSet GetList(string strWhere)
        {
            return DbHelperSQL.Query(strWhere.ToString());
        }


    }
}
